<?php 
defined('IN_TS') or die('Access Denied.');

include 'userinfo.php';

$page = isset($_GET['page']) ? intval($_GET['page']) : '1';
$url = tsUrl('user','topic',array('id'=>$strUser['userid'],'page'=>''));
$lstart = $page*30-30;

$arrTopics = $new['user']->findAll('group_topic',array(
	'userid'=>$strUser['userid'],
),'addtime desc',null,$lstart.',30');

if( is_array($arrTopics)){
	foreach($arrTopics as $key=>$item){
		$arrTopic[] = $item;
		$arrTopic[$key]['title'] = tsTitle($item['title']);
		$arrTopic[$key]['content'] = tsDecode($item['content']);
		$arrTopic[$key]['typename'] = $arrTopicType[$item['typeid']]['typename'];
		$arrTopic[$key]['user'] = aac('user')->getOneUser($item['userid']);
		$arrTopic[$key]['group'] = aac('group')->getOneGroup($item['groupid']);
	}
}

$topicNum = $new['user']->findCount('group_topic',array(
	'userid'=>$strUser['userid'],
));
$pageUrl = pagination($topicNum, 30, $page, $url);

$title = $strUser['username'].'的话题';
include template('topic');